
/******************************************************************************
 * Copyright Cambridge Silicon Radio Limited 2014 - 2015.
 ******************************************************************************/

package com.ihomey.linkuphome;

import com.ihomey.linkuphome.entities.Device;
import com.ihomey.linkuphome.entities.GroupDevice;
import com.ihomey.linkuphome.entities.LightState;
import com.ihomey.linkuphome.entities.SingleDevice;
import com.ihomey.linkuphome.listeners.AssociationListener;
import com.ihomey.linkuphome.listeners.BatteryListener;
import com.ihomey.linkuphome.listeners.GroupListener;
import com.ihomey.linkuphome.listeners.RemovedListener;

import java.util.List;


/**
 * Defines an interface that Fragments can use to communicate with the Activity.
 */
public interface DeviceController {

    public void discoverDevices(boolean enabled, AssociationListener listener);

    public void  loadSetting(int settingsID);

    public Device getDevice(int deviceId);

    public Device getDevice(int deviceId, int type);

    public void removeAllDevices();


    public void cancelTransaction();

    public void removeAllGroupDevices();

    public String getDataBaseAsJson();

    public boolean setConfigurationFromJson(String configuration, int lightType);

    public LightState getLightState(int deviceId);

    public void getBatteryState(int deviceId, BatteryListener batteryListener);

    public List<Device> getGroups();

    public GroupDevice addLightGroup();

    public void deleteLightGroup(int deviceId);

    public void deleteModel(int groupId,int deviceId);

    public List<SingleDevice> getDevices(int... modelNumber);

    public List<SingleDevice> getBoundedDevices(int groupId, int... modelNumber);

    public List<SingleDevice> getUnBoundedDevices(int groupId, int... modelNumber);

    public void setSelectedDeviceId(int deviceId);

    public int getSelectedDeviceId();

    public int getDeviceType();

    public void setDeviceType(int deviceType);

    public void postRunnable(Runnable checkScanInfoRunnable);

    public void removeRunnable(Runnable checkScanInfoRunnable);

    public void updateControls(int selectedDeviceId);

    public void updateDeviceName(int deviceId, String name);

    public void updateDeviceLightState(LightState lightState);

    public void associateDevice(int uuidHash, String shortCode);

    public void setDeviceGroups(List<Integer> groups, GroupListener listener);

    public void removeDevice(SingleDevice device, RemovedListener listener);

    public void removeDeviceLocally(int deviceId, RemovedListener listener);

}

